
public class Main {
    public static void main(String[] args) {
        FlyweightFactory factory = new FlyweightFactory();
        Flyweight flyweightTom = factory.getFlywight("ONE");
        Flyweight flyweightJerry =factory.getFlywight("TWO");
        System.out.println(flyweightTom.operation()+"  "+flyweightTom.hashCode());
        System.out.println(flyweightJerry.operation()+"  "+flyweightJerry.hashCode());
        flyweightTom = factory.getFlywight("ONE");
        System.out.println(flyweightTom.operation()+"  "+flyweightTom.hashCode());
    }
}